package gui;

	import java.awt.GridBagLayout;
	import javax.swing.JPanel;
	import javax.swing.JLabel;
	import java.awt.Rectangle;
	import javax.swing.JTextField;
	import javax.swing.JTextArea;
	import javax.swing.JComboBox;

	import javax.swing.JButton;
import javax.swing.SpringLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

	public class prevSemester extends JPanel{
		private String year=null;
		public prevSemester() {
			SpringLayout springLayout = new SpringLayout();
			setLayout(springLayout);
			
			JPanel panel = new JPanel();
			springLayout.putConstraint(SpringLayout.NORTH, panel, 30, SpringLayout.NORTH, this);
			springLayout.putConstraint(SpringLayout.WEST, panel, 38, SpringLayout.WEST, this);
			springLayout.putConstraint(SpringLayout.SOUTH, panel, -34, SpringLayout.SOUTH, this);
			springLayout.putConstraint(SpringLayout.EAST, panel, -24, SpringLayout.EAST, this);
			add(panel);
			SpringLayout sl_panel = new SpringLayout();
			panel.setLayout(sl_panel);
			
			
			JLabel label = new JLabel("Select the number of Semester, and then select a course");
			sl_panel.putConstraint(SpringLayout.NORTH, label, 22, SpringLayout.NORTH, panel);
			sl_panel.putConstraint(SpringLayout.WEST, label, 26, SpringLayout.WEST, panel);
			panel.add(label);
			
			JComboBox comboBox = new JComboBox();
			sl_panel.putConstraint(SpringLayout.WEST, comboBox, 130, SpringLayout.WEST, panel);
			panel.add(comboBox);
			/*for(Student s:Test.students){
				comboBox.addItem(s.getId());
			}
			comboBox.addItemListener(new java.awt.event.ItemListener() {
				public void itemStateChanged(java.awt.event.ItemEvent e) {
					System.out.println("itemStateChanged()"); 
					for(Student s:Test.students){
					       if (s.getId()==(String)comboBox.getSelectedItem())
						   loadStudent(s);						
					         }
					}
				
			});*/
		
			
			JLabel label_2 = new JLabel("course");
			sl_panel.putConstraint(SpringLayout.NORTH, comboBox, -3, SpringLayout.NORTH, label_2);
			sl_panel.putConstraint(SpringLayout.EAST, label_2, 0, SpringLayout.EAST, label);
			panel.add(label_2);
			
			JButton btnNext = new JButton("next");
			btnNext.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
				
				
				}
			});
			sl_panel.putConstraint(SpringLayout.WEST, btnNext, 160, SpringLayout.WEST, panel);
			sl_panel.putConstraint(SpringLayout.SOUTH, btnNext, -27, SpringLayout.SOUTH, panel);
			panel.add(btnNext);
			
			JComboBox comboBox_1 = new JComboBox();
			sl_panel.putConstraint(SpringLayout.EAST, comboBox, 0, SpringLayout.EAST, comboBox_1);
			sl_panel.putConstraint(SpringLayout.WEST, comboBox_1, 128, SpringLayout.WEST, panel);
			panel.add(comboBox_1);
			
			JLabel label_1 = new JLabel("Semester Number");
			sl_panel.putConstraint(SpringLayout.NORTH, label_2, 32, SpringLayout.SOUTH, label_1);
			sl_panel.putConstraint(SpringLayout.EAST, comboBox_1, -21, SpringLayout.WEST, label_1);
			sl_panel.putConstraint(SpringLayout.NORTH, label_1, 40, SpringLayout.SOUTH, label);
			sl_panel.putConstraint(SpringLayout.NORTH, comboBox_1, -3, SpringLayout.NORTH, label_1);
			sl_panel.putConstraint(SpringLayout.EAST, label_1, 0, SpringLayout.EAST, label);
			panel.add(label_1);
		}
	}


